<?php
if (php_sapi_name() !== 'cli') {}
if (PHP_SAPI !== 'cli') {}
if ($object->php_sapi_name() === true) {}
if ($object?->php_sapi_name() === true) {}
